package experiment_4;

public class Salary {
    public static float Amount(String[] arr) {
        float salary = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].equals("A")) {
                salary += 450;
            }
            if (arr[i].equals("B")) {
                salary += 350;
            }
            if (arr[i].equals("C")) {
                salary += 200;
            }
        }
        System.out.println("这月工资为：" + salary);
        return salary;
    }

    public static final void realsalaryes(float x) {
        if (x < 0) {
            System.out.println("输入错误");
        }
        if (x <= 5000) {
            System.out.println("税后收入为：" + x);
        }
        if (5000 < x && x < 8000) {
            System.out.println("税后收入为：" + (float) (5000 + (x - 5000) * 0.97));
        }
        if (x > 8000 && x < 17000) {
            System.out.println("税后收入为：" + (5000 + 3000 * 0.97 + (x - 8000) * 0.9));
        }
        if (x > 17000 && x < 30000) {
            System.out.println("税后收入为：" + (float) (5000 + 3000 * 0.97 + (17000 - 8000) * 0.9
                    + (x - 17000) * 0.8));
        }
        if (x >= 30000) {
            System.out.println("Are you sure?");
        }
    }
}
